<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%condition}}".
 *
 * @property integer $id
 * @property integer $solution_id
 * @property integer $type_id
 * @property integer $use_whitelist
 * @property integer $is_limit
 * @property string $last_update
 */
class Condition extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%condition}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['solution_id', 'type_id'], 'required'],
            [['solution_id', 'type_id', 'use_whitelist', 'is_limit'], 'integer'],
            [['last_update'], 'safe'],
            [['solution_id', 'type_id'], 'unique', 'targetAttribute' => ['solution_id', 'type_id'], 'message' => 'The combination of Solution ID and Type ID has already been taken.']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'solution_id' => 'Solution ID',
            'type_id' => 'Type ID',
            'use_whitelist' => 'Use Whitelist',
            'is_limit' => 'Is Limit',
            'last_update' => 'Last Update',
        ];
    }
}
